﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using CredentialsService.Data;

namespace CredentialsService.Persistence
{
    public class ApplicationEntityTypeConfiguration : EntityTypeConfiguration<Application>
    {
        public ApplicationEntityTypeConfiguration()
        {
            ToTable("Applications", "dbo");
            HasKey(a=>a.Id);
            Property(a => a.Id)
                .HasColumnName("ApplicationId")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(a => a.Name)
                .HasColumnName("ApplicationName");
        }
    }
}